import { ApiVersoin, ConfigEnum, ContentTypeEnum, MicroServiceEnum } from '@/common/enums/httpEnum'
const Url = {
  contractShow: `/contract/show`,
  contractInfo: `${ApiVersoin.V4}/contract/info`,
  leaseInfo: `/sign/get-lease-info`,
  onlineOnline: `/sign/cancel-online-contract`,
  renewApply: `renew/apply`,
  allContract: `/contract/all-list`,
  reserveClause: `${ApiVersoin.V4}/reserve/clause`,
  getContractDetail: `/renew/get-contract-detail`,
  getFireVideo: '/api/config/get-fire-video',
  getSignUrl: `/applet/best-sign-h5-renew/get-sign-url`,
  renewGiveUp: `/renew/give-up`,
  getProjectId: `${ApiVersoin.V3}/apply-checkout-settings/get-setting`,
  getSimpleDetail: `${ApiVersoin.V3}/apply-checkout-settings/get-simple-detail`,
  getCheckoutList: `${ApiVersoin.V3}/apply-checkout-settings/contract-apply-checkout-list`,
  cancelApplication: `${ApiVersoin.V3}/apply-checkout-settings/cancel`,
  checkoutApply: `${ApiVersoin.V3}/apply-checkout-settings/apply`,
}

// 获取签字后面得合同
export const contractShow = (params) => uni.$uv.http.get(Url.contractShow, { params, custom: { showLoading: true } })

// 合同详情
export const contractInfo = (params) => uni.$uv.http.get(Url.contractInfo, { params, custom: { showLoading: true } })

// 我的合同
export const allContract = (data) => uni.$uv.http.get(Url.allContract, { data, custom: { showLoading: true } })

// 获取租约信息
export const leaseInfo = (params) => uni.$uv.http.get(Url.leaseInfo, { params, custom: { showLoading: true } })

// 放弃签字
export const onlineOnline = (params) => uni.$uv.http.get(Url.onlineOnline, { params, custom: { showLoading: true } })

// 申请续租
export const renewApply = (params) => uni.$uv.http.post(Url.renewApply, params, { custom: { showLoading: true } })

// 预定协议
export const reserveClause = (data) => uni.$uv.http.get(Url.reserveClause, { data, custom: { showLoading: true } })

// 续租详情
export const getContractDetail = (data) => uni.$uv.http.get(Url.getContractDetail, { data, custom: { showLoading: true } })

//获取消防视频
export const getFireVideo = (params) =>
  uni.$uv.http.get(Url.getFireVideo, {
    params,
    header: { [ConfigEnum.MICRO_SERVICE_PLATFORM]: MicroServiceEnum.GATEWAY, authorization: 'szct' },
    custom: { showLoading: true },
  })
// 续租详情
export const getSignUrl = (data) => uni.$uv.http.get(Url.getSignUrl, { data, custom: { showLoading: true } })

// 续租放弃签字
export const renewGiveUp = (data) => uni.$uv.http.get(Url.renewGiveUp, { data, custom: { showLoading: true } })
// 租客获取项目申请退房配置设置信息
export const getProjectIdApi = (data) => uni.$uv.http.get(Url.getProjectId, { data, custom: { showLoading: true } })
//获取合同信息
export const getSimpleDetailApi = (data) => uni.$uv.http.get(Url.getSimpleDetail, { data, custom: { showLoading: true } })
//获取合同退房进度列表
export const getCheckoutListApi = (data) => uni.$uv.http.get(Url.getCheckoutList, { data, custom: { showLoading: true } })
// 租客撤销申请退房
export const cancelApplicationApi = (params) =>
  uni.$uv.http.post(Url.cancelApplication, params, { header: { [ConfigEnum.CONTENT_TYPE]: ContentTypeEnum.JSON }, custom: { showLoading: true } })
//租客发起申请退房
export const checkoutApplyApi = (params) =>
  uni.$uv.http.post(Url.checkoutApply, params, { header: { [ConfigEnum.CONTENT_TYPE]: ContentTypeEnum.JSON }, custom: { showLoading: true } })
